package com.corpdata.service;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.corpdata.common.result.Result;
import com.corpdata.common.utils.ResultUtil;
import com.corpdata.entity.OrgUser;

@Service
public class LoginService {
	
	@Autowired
	private OrgUserService orgUserService;
	
	/**
	 * 系统登录
	 * @param userId
	 * @param pwd
	 * @return
	 */
	public Result doLogin(String userId,String pwd,HttpServletRequest request){
		return orgUserService.login(userId,request);
		
	}
	
	public Result logout(HttpServletRequest request){
		request.getSession().removeAttribute("userinfo");
		return ResultUtil.success();
	}
}
